<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>Aloha Editor</title>
  <meta name="description" content="The world's most advanced browser HTML5 based WYSIWYG editor lets you experience a whole new way of editing." />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="css/api.css" />
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script>
  <script src="js/jquery-bbq.js"></script>
  <script src="js/api.js"></script>
  <script src="js/lib/modernizr-1.7.min.js"></script>
  <!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
</head>

  <body id="docs">
<!-- ============================== header ================================= -->
    <!-- begin static/header.html -->
      <header role="banner">
    <div class="container">
      <h1 id="logo">
        <a href="http://aloha-editor.org"><img src="img/logo.png" alt="Aloha Editor" /></a>
        </h1>

      <nav role="navigation">
        <ul>
          <li><a href="http://aloha-editor.org/about.php">About</a></li>
          <li><a href="#">Guides</a></li>
          <li class="active"><a href="http://aloha-editor.org/api" >API Docs</a></li>
          <li><a href="http://getsatisfaction.com/aloha_editor">Forum</a></li>
        </ul>
      </nav>
    </div>
  </header>
  


    <!-- end static/header.html -->

<!-- ============================== classes index ============================ -->

    <section id="list">
      <header>
        <form action="#" role="search">
          <input type="text" />
          <a href="#" class="search-reset"></a>
        </form>
      </header>
      <div>
        <span class="odd active"><a href="/">API Documentation Index</a></span>
	
	<span class='even' global><a href="../symbols/_global_.html">_global_</a></span>
	
	<span class='odd'><a href="../symbols/Aloha.Editable.html">Aloha.Editable</a></span>
	
	<span class='even'><a href="../symbols/Aloha.Message.html">Aloha.Message</a></span>
	
	<span class='odd'><a href="../symbols/Aloha.RepositoryDocument.html">Aloha.RepositoryDocument</a></span>
	
	<span class='even'><a href="../symbols/Aloha.RepositoryFolder.html">Aloha.RepositoryFolder</a></span>
	
	<span class='odd'><a href="../symbols/Aloha.RepositoryManager.html">Aloha.RepositoryManager</a></span>
	
	<span class='even'><a href="../symbols/Aloha.ui.Button.html">Aloha.ui.Button</a></span>
	
	<span class='odd'><a href="../symbols/Aloha.ui.MultiSplitButton.html">Aloha.ui.MultiSplitButton</a></span>
	
	<span class='even'><a href="../symbols/Array.html">Array</a></span>
	
	<span class='odd'><a href="../symbols/block.html">block</a></span>
	
	<span class='even'><a href="../symbols/block.block.html">block.block</a></span>
	
	<span class='odd'><a href="../symbols/block.block.AbstractBlock.html">block.block.AbstractBlock</a></span>
	
	<span class='even'><a href="../symbols/block.block.DebugBlock.html">block.block.DebugBlock</a></span>
	
	<span class='odd'><a href="../symbols/block.block.DefaultBlock.html">block.block.DefaultBlock</a></span>
	
	<span class='even'><a href="../symbols/block.BlockContentHandler.html">block.BlockContentHandler</a></span>
	
	<span class='odd'><a href="../symbols/block.blockmanager.html">block.blockmanager</a></span>
	
	<span class='even'><a href="../symbols/block.editor.html">block.editor</a></span>
	
	<span class='odd'><a href="../symbols/block.editor.AbstractEditor.html">block.editor.AbstractEditor</a></span>
	
	<span class='even'><a href="../symbols/block.editor.AbstractFormElementEditor.html">block.editor.AbstractFormElementEditor</a></span>
	
	<span class='odd'><a href="../symbols/block.editor.EmailEditor.html">block.editor.EmailEditor</a></span>
	
	<span class='even'><a href="../symbols/block.editor.NumberEditor.html">block.editor.NumberEditor</a></span>
	
	<span class='odd'><a href="../symbols/block.editor.StringEditor.html">block.editor.StringEditor</a></span>
	
	<span class='even'><a href="../symbols/block.editor.UrlEditor.html">block.editor.UrlEditor</a></span>
	
	<span class='odd'><a href="../symbols/block.editormanager.html">block.editormanager</a></span>
	
	<span class='even'><a href="../symbols/block.sidebarattributeeditor.html">block.sidebarattributeeditor</a></span>
	
	<span class='odd'><a href="../symbols/Boolean.html">Boolean</a></span>
	
	<span class='even'><a href="../symbols/contenthandler.html">contenthandler</a></span>
	
	<span class='odd'><a href="../symbols/Date.html">Date</a></span>
	
	<span class='even'><a href="../symbols/diff_match_patch.html">diff_match_patch</a></span>
	
	<span class='odd'><a href="../symbols/Ext.html">Ext</a></span>
	
	<span class='even'><a href="../symbols/Ext.DomQuery.html">Ext.DomQuery</a></span>
	
	<span class='odd'><a href="../symbols/Ext.TaskMgr.html">Ext.TaskMgr</a></span>
	
	<span class='even'><a href="../symbols/Ext.util.TaskRunner.html">Ext.util.TaskRunner</a></span>
	
	<span class='odd'><a href="../symbols/Function.html">Function</a></span>
	
	<span class='even'><a href="../symbols/GENTICS.Utils.RangeObject.html">GENTICS.Utils.RangeObject</a></span>
	
	<span class='odd'><a href="../symbols/GENTICS.Utils.RangeTree.html">GENTICS.Utils.RangeTree</a></span>
	
	<span class='even'><a href="../symbols/jQuery.html">jQuery</a></span>
	
	<span class='odd'><a href="../symbols/jQuery.fn.html">jQuery.fn</a></span>
	
	<span class='even'><a href="../symbols/patch_obj.html">patch_obj</a></span>
	
	<span class='odd'><a href="../symbols/rangy-Module.html">rangy-Module</a></span>
	
	<span class='even'><a href="../symbols/String.html">String</a></span>
	
	<span class='odd'><a href="../symbols/Ui.AttributeField.html">Ui.AttributeField</a></span>
	

      </div>
    </section>
    <footer>
      <a href="https://github.com/alohaeditor/Aloha-Editor/issues" class="button secondary">REPORT AN ISSUE</a>
    </footer>

    <div role="main">
      <section id="documentation">
<!-- ============================== class title ============================ -->
        <h1 class="classTitle">
          
          Built-In Namespace: String
        </h1>

<!-- ============================== class summary ========================== -->
        <p class="description">
          <span class="extends">
          
          </span>

          

          
        </p>


<!-- ============================== properties summary ===================== -->
      
      
        
        <h2>Field Summary</h2>
        <div id="properties">
        
          <ul>
          
            <li>
              <a href="../symbols/String.html#trim">trim</a>
            </li>
          
          </ul>
        

        
        </div>
      




<!-- ============================== methods summary ======================== -->
      
      
        
        
      
        
        
          <h2>Instance Methods</h2>
          <ul class="methods">
          
            <li class="fixedFont"><a href="../symbols/String.html#toggle">toggle</a></li>
          
          </ul>
        
      
<!-- ============================== events summary ======================== -->
      



<!-- ============================== field details ========================== -->
      
        <h2>
          Field Detail
        </h2>
        
          <a name="trim"> </a>
          <span class="light"><a href="../symbols/String.html">String</a></span>
          <span class="property"><b>trim</b></span>

          <div class="description">
            <p>Trims whitespace from either end of a string, leaving spaces within the string intact.  Example:</p>

<pre><code class='syntax js'><span class="keyword">var</span> <span class="variable">s</span> = <span class="string">'  foo bar  '</span>;
<span class="variable">alert</span>(<span class="string">'-'</span> + <span class="variable">s</span> + <span class="string">'-'</span>);         <span class="comment">//alerts &quot;- foo bar -&quot;</span>
<span class="variable">alert</span>(<span class="string">'-'</span> + <span class="variable">s</span>.<span class="variable">trim</span>() + <span class="string">'-'</span>);  <span class="comment">//alerts &quot;-foo bar-&quot;</span>
</code></pre>
            
              <br />
              <span class="definedin">Defined in: </span> <a href="../symbols/src/_Users_rene_evo42_app_aloha_Aloha-Editor_src_lib_aloha.js.html">aloha.js</a>.
            
            
          </div>

          

            
            
            
            

        
      


<!-- ============================== method details ========================= -->
      
        
        
      
        
        
          <h2>Instance Method Detail</h2>
          
            <a name="toggle"> </a>
            <div class="fixedFont">
              <span class="methodname">toggle</span>
            </div>
            <div class="description">
              <p>Utility function that allows you to easily switch a string between two alternating values.  The passed value
is compared to the current string, and if they are equal, the other value that was passed in is returned.  If
they are already different, the first value passed in is returned.  Note that this method returns the new value
but does not change the current string.</p>

<pre><code class='syntax js'><span class="comment">// alternate sort directions</span>
<span class="variable">sort</span> = <span class="variable">sort</span>.<span class="variable">toggle</span>(<span class="string">'ASC'</span>, <span class="string">'DESC'</span>);

<span class="comment">// instead of conditional logic:</span>
<span class="variable">sort</span> = (<span class="variable">sort</span> == <span class="string">'ASC'</span> ? <span class="string">'DESC'</span> : <span class="string">'ASC'</span>);
</code></pre>
              
                <br />
                <span class="definedin">Defined in: <a href="../symbols/src/_Users_rene_evo42_app_aloha_Aloha-Editor_src_lib_aloha.js.html">aloha.js</a>.</span>
              
              
            </div>

            

              
                <dl class="parameters">
                <dt class="heading">Parameters:</dt>
                
                  <dt>
                    <span class="light fixedFont"><a href="../symbols/String.html">String</a></span> <b>value</b>
                    
                  </dt>
                  <dd>The value to compare to the current string</dd>
                
                  <dt>
                    <span class="light fixedFont"><a href="../symbols/String.html">String</a></span> <b>other</b>
                    
                  </dt>
                  <dd>The new value to use if the string already equals the first value passed in</dd>
                
                </dl>
              
              
              
              
              
                <dl class="returns">
                <dt class="heading">Returns:</dt>
                
                  <dd><span class="light fixedFont"><a href="../symbols/String.html">String</a></span> The new value</dd>
                
                </dl>
              
              
              

          
        
      

<!-- ============================== event details ========================= -->
      



<!-- ============================== footer ================================= -->
        <div class="fineprint" style="clear:both">
          
          Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Nov 30 2011 13:33:45 GMT+0100 (CET)
        </div>
      </section>
    </div>
  </body>
</html>
